package com.lzh.common.utils;


import javax.swing.text.DateFormatter;
import java.text.DateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * 时间工具类
 */
public class DateUtil {



    public static String getSystemTimeYm(){
        LocalDate localDate = LocalDate.now();

        DateTimeFormatter ymm = DateTimeFormatter.ofPattern("yMM");
        String time = localDate.format(ymm);
        time = time.substring(2);
        return time;

    }

    public static String getSystemTimeYyyyMmDd(){
        LocalDate localDate = LocalDate.now();

        DateTimeFormatter ymm = DateTimeFormatter.ofPattern("yyyyMMdd");
        String time = localDate.format(ymm);
        System.out.println(time);

        return time;

    }
}
